package com.heima.article.service.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.heima.article.mapper.ArticleMapper;
import com.heima.article.service.ArticleService;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.article.pojos.ApArticle;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, ApArticle> implements ArticleService {
    @Autowired
    private  ArticleMapper articleMapper;

    @Override
    public ResponseResult<List<ApArticle>> load(ArticleDto articleDto) {
        List<ApArticle> apArticleList = articleMapper.ListAll(articleDto);
        ResponseResult responseResult = ResponseResult.okResult(apArticleList);
        return  responseResult;


    }

    @Override
    public ResponseResult<List<ApArticle>> loads(ArticleDto articleDto) {
        List<ApArticle> apArticleList = articleMapper.ListAll(articleDto);
        ResponseResult responseResult = ResponseResult.okResult(apArticleList);
        return  responseResult;
    }


}
